<template>
  <div>
<h1>孙组件-从父组件获取的数据{{ data }}</h1>
  </div>
</template>

<script setup>
import { inject } from 'vue';

//inject 
const data=inject('key')
</script>

<style lang="scss" scoped>

</style>